<?php
header("Pragma: public");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: pre-check=0, post-check=0, max-age=0");
header("Pragma: no-cache");
header("Expires: 0");
header("Content-Transfer-Encoding: none");
header("Content-Type: application/vnd.ms-excel;");
header("Content-type: application/x-msexcel");
header("Content-Disposition: attachment; filename=report_".$this->year.'_'.$this->month.".xls");
?>
<html>
<head></head>
<body>
<table border="1">
<tr>
    <th>订单号</th>
    <th>客户名称</th>
    <th>邮箱地址</th>
    <th>国家</th>
    <th>电话</th>
    <th>post_code</th>
    <th>金额</th>
</tr>
<?php
foreach ($this->list AS $row) {
?>
<tr>
    <td><?=$row['orderid']?></td>
    <td><?=$row['name']?></td>
    <td><?=$row['email']?></td>
    <td><?=$row['flname']?></td>
    <td><?=$row['phone']?></td>
    <td><?=$row['post_code']?></td>
    <td><?=$row['money']?></td>
</tr>
<?php
	$product = unserialize($row['order_string']);
	if(is_array($product)):
?>
<tr>
    <th>&nbsp;</th>
    <th>产品号</th>
    <th>产品名称</th>
    <th>数量</th>
    <th>&nbsp;</th>
    <th>&nbsp;</th>
    <th>&nbsp;</th>
</tr>
<?php foreach ($product as $prow) { ?>
<tr>
    <td>&nbsp;</td>
    <td><?=$prow['itemid']?></td>
    <td><?=$prow['subject']?></td>
    <td><?=$prow['amounts']?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
</tr>
<?php
}
endif; 
}
?>
</table>
</body>
</html>